package com.education.welco.service.impl;

import com.education.common.utils.Convert;
import com.education.welco.mapper.LPaperQueRelationMapper;
import com.education.welco.pojo.LPaperQueRelation;
import com.education.welco.service.ILPaperQueRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 试卷和试题关联 服务层实现
 *
 * @author d
 * @date 2020-06-11
 */
@Service
public class LPaperQueRelationServiceImpl implements ILPaperQueRelationService {

    @Autowired
    private LPaperQueRelationMapper lPaperQueRelationMapper;

    /**
     * 查询试卷和试题关联信息
     *
     * @param paperId 试卷和试题关联ID
     * @return 试卷和试题关联信息
     */
    @Override
    public LPaperQueRelation selectLPaperQueRelationById(Integer paperId) {
        return lPaperQueRelationMapper.selectLPaperQueRelationById(paperId);
    }

    /**
     * 查询试卷和试题关联列表
     *
     * @param lPaperQueRelation 试卷和试题关联信息
     * @return 试卷和试题关联集合
     */
    @Override
    public List<LPaperQueRelation> selectLPaperQueRelationList(LPaperQueRelation lPaperQueRelation) {
        return lPaperQueRelationMapper.selectLPaperQueRelationList(lPaperQueRelation);
    }

    /**
     * 新增试卷和试题关联
     *
     * @param lPaperQueRelation 试卷和试题关联信息
     * @return 结果
     */
    @Override
    public int insertLPaperQueRelation(LPaperQueRelation lPaperQueRelation) {
        return lPaperQueRelationMapper.insertLPaperQueRelation(lPaperQueRelation);
    }

    /**
     * 修改试卷和试题关联
     *
     * @param lPaperQueRelation 试卷和试题关联信息
     * @return 结果
     */
    @Override
    public int updateLPaperQueRelation(LPaperQueRelation lPaperQueRelation) {
        return lPaperQueRelationMapper.updateLPaperQueRelation(lPaperQueRelation);
    }

    /**
     * 删除试卷和试题关联对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLPaperQueRelationByIds(String ids) {
        return lPaperQueRelationMapper.deleteLPaperQueRelationByIds(Convert.toStrArray(ids));
    }
}